<template>
  <div>
    <!-- 头部部分 -->
    <header class="header">
      <h1>todos</h1>
      <input
        @keyup.enter="addList(todoName)"
        class="new-todo"
        placeholder="请输入任务名称"
        v-model="todoName"
        autofocus
      />
    </header>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      todoName: '',
    }
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    //添加
    addList(todoName) {
      this.$emit('addList', todoName)
    },
  },
}
</script>

<style scoped></style>
